import { AssetInfo } from "@cocos/creator-types/editor/packages/asset-db/@types/public";
import { compress } from "./tinypng";


export function onAssetMenu(assetInfo:AssetInfo){
    return [
        {
            label:'i18n:hiyooo-plugin-framework.name',
            submenu:[
                {
                    label:'i18n:hiyooo-plugin-framework.script',
                    submenu:[
                       {
                        label:'i18n:hiyooo-plugin-framework.createGameComponent',
                        click:()=>{
                            Editor.Panel.open('hiyooo-plugin-framework.create_file',assetInfo.file,"createGameComponent")
                        }
                       } ,
                       {
                        type:'separator'
                       },
                       {
                        label:'i18n:hiyooo-plugin-framework.createModule',
                        click:()=>{
                            Editor.Panel.open('hiyooo-plugin-framework.create_file',assetInfo.file,"createModule")
                        }
                       },
                       {
                        label:'i18n:hiyooo-plugin-framework.createModel',
                        click:()=>{
                            Editor.Panel.open('hiyooo-plugin-framework.create_file',assetInfo.file,"createModel")
                        }
                       },
                       {
                        label:'i18n:hiyooo-plugin-framework.createView',
                        click:()=>{
                            Editor.Panel.open('hiyooo-plugin-framework.create_file',assetInfo.file,"createView")
                        }
                       },
                       {
                        label:'i18n:hiyooo-plugin-framework.createBll',
                        click:()=>{
                            Editor.Panel.open('hiyooo-plugin-framework.create_file',assetInfo.file,"createBll")}
                       },
                       {
                        label:'i18n:hiyooo-plugin-framework.createMvvm',
                        click:()=>{
                            Editor.Panel.open('hiyooo-plugin-framework.create_file',assetInfo.file,"createMvvm")
                        }
                       },
                    ]
                },
                {
                    label:'i18n:hiyooo-plugin-framework.tools',
                    submenu:[
                        {
                            label:'i18n:hiyooo-plugin-framework.tinyCompress',
                            click:()=>{
                                compress(assetInfo.file)
                            }
                        },
                    ],

                    
                },
            ]
        }
    ]
}